from django.urls import path
from book.views import index,register,shop,login,get_json,get_header_info,json_data,weibo,set_cookie,get_cookie
from django.urls import converters
from django.urls.converters import IntConverter
class MobileConverter:
    regex = '1[3-9]\d{9}'

    def to_python(self, value):
        return value
from django.urls.converters import register_converter
register_converter(MobileConverter,'phone')

urlpatterns =[
    path('index/',index),
    path('register/<phone:mobile>/',register),
    path('<int:pro_id>/<int:city_id>/',shop),
    path('login/',login),
    path('json/',get_json),
    path('header/',get_header_info),
    path('jsondata/',json_data),
    path('weibo/',weibo),
    path('set_cookie/',set_cookie),
    path('get_cookie/',get_cookie)
]